package com.office.onlineInformation.draftBox.dao;

import com.office.onlineInformation.draftBox.pojo.OaOnlineMessage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 88168
 * @since 2022-10-25
 */
@Mapper
public interface draftBoxMapper extends BaseMapper<OaOnlineMessage> {
    /**
     * 查询草稿箱留言
     * @param message
     * @return
     */
    List<OaOnlineMessage> getList(@Param("pojo") OaOnlineMessage message);

    /**
     * 删除未发送的留言
     * @param informationId
     * @return
     */
    int updateUnsend(@Param("id") int informationId);

    /**
     * 修改留言
     * @param onlineMessage
     * @return
     */
    int updateMessage(@Param("pojo") OaOnlineMessage onlineMessage);

    /**
     * 根据id查
     * @param informationId
     * @return
     */
    OaOnlineMessage getDraftById(@Param("id") int informationId);
    /**
     * 添加草稿
     * @param onlineMessage
     * @return
     */
    int insertDraft(@Param("pojo") OaOnlineMessage onlineMessage);


}
